package com.xdtech.forum.service;

import java.util.List;
import java.util.Map;

import com.xdtech.common.service.IBaseService;
import com.xdtech.forum.model.Article;
import com.xdtech.forum.vo.ArticleItem;
import com.xdtech.web.model.Pagination;

/**
 * 
 * @author max.zheng
 * @create 2014-12-06 20:53:58
 * @since 1.0
 * @see
 */
public interface ArticleService extends IBaseService<Article>{

	/**
	 * 保存更新信息
	 * @author max.zheng
	 * @create 2014-12-06 20:53:58
	 * @modified by
	 * @param item
	 * @return
	 */
	boolean saveOrUpdateArticle(ArticleItem item);

	/**
	 * 加载记录信息
	 * @author max.zheng
	 * @create 2014-12-06 20:53:58
	 * @modified by
	 * @param newId
	 * @return
	 */
	ArticleItem loadArticleItem(Long articleId);
	/**
	 * 加载所有的帖子信息
	 * 
	 * @author max.zheng
	 * @create 2014-12-6下午11:16:07
	 * @modified by
	 * @return
	 */
	List<ArticleItem> loadArticleItems();

	/**
	 * 根据id号删除记录信息
	 * @author max.zheng
	 * @create 2014-12-06 20:53:58
	 * @modified by
	 * @param id
	 * @return
	 */
	boolean deleteArticleInfo(long id);

	/**
	 * 
	 * @author max.zheng
	 * @create 2014-12-06 20:53:58
	 * @modified by
	 * @param articleIds
	 */
	boolean deleteArticleInfo(List<Long> articleIds);

	/**
	 * 加载会员发表的帖子
	 * @author max.zheng
	 * @create 2014-12-7下午7:49:09
	 * @modified by
	 * @param id
	 * @return
	 */
	List<ArticleItem> loadArticleItemsByMemberId(Long id);

	/**
	 * 根据文章类别加载文章列表
	 * @author max.zheng
	 * @create 2015-3-5下午10:40:08
	 * @modified by
	 * @param ctgId
	 * @return
	 */
	List<ArticleItem> loadArticleItemsByCtgId(Long ctgId);

	/**
	 * 加载热门文章
	 * @author <a href="max.zheng@zkteco.com">郑志雄</>
	 * @since 2015-3-6 下午4:37:23
	 * @return
	 */
	List<ArticleItem> loadArticleHotItems();

	/**
	 * 根据帖子类型\关键字加载帖子
	 * @author <a href="max.zheng@zkteco.com">郑志雄</>
	 * @since 2015-3-10 下午3:45:58
	 * @param pg
	 * @param ctgId 类别id
	 * @return
	 */
	Map<String, Object> loadPageByTypeAndKey(Pagination pg, String ctgId,String keyword);

}
